home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 25 / Cream of the Crop 25.iso / bbs / doorinfo.zip / DOORUTIL.H < prev    next >
C/C++ Source or Header  |  1997-05-14  |  7KB  |  265 lines

  1. /*
  2. **
  3. ** Prototype list for DOORUTIL.H
  4. **
  5. */
  6.  
  7. #include "structs.h"
  8. #include "bbscfg.h"
  9.  
  10. struct msg3
  11. {
  12.     int type;                   /* will always be 7 */
  13.     int line;                   /* the line number for this task (0-5) */
  14.     int inq;                    /* the queue to read incoming data from */
  15.     int outq;                   /* the queue to send outgoing data to */
  16.     struct acct_rec far *acctptr;         /* a pointer to an array of structures */
  17.     struct user_rec far *userptr;
  18.     int numlines;               /* how many lines are configured */
  19.     struct cfg_rec far *cfgptr; /* pointer to BBSCFG record */
  20. };
  21.  
  22. struct msg1
  23. {
  24.     int type;
  25.     int count;
  26.     char text[1200];
  27. };
  28.  
  29. struct msg7
  30. {
  31.     int type;
  32.     int line;
  33.     int count;
  34.     char text[80];
  35. };
  36.  
  37. struct msg4
  38. {
  39.     int type;
  40.     int oba;    /* how many bytes available in output buffer */
  41.     int count;  /* how many bytes currently in output buffer */
  42. };
  43.  
  44. /*
  45. ** Thsi structure is used for broadcast to multiple lines
  46. */
  47.  
  48. struct msg5
  49. {
  50.     int type;
  51.     char far *text;
  52.     int far *flag;
  53.     int sendto[65];
  54.     int tcbnum;
  55. };
  56.  
  57. struct msg6
  58. {
  59.     int m6type;
  60.     int m6line;
  61.     int m6msgnum;
  62.     int m6ansiflag;
  63.     int m6tcbnum;
  64.     char far *m6text;
  65.     int far *m6flag;
  66. };
  67.  
  68.  
  69. /*
  70. ** cbr is a structure used when making database calls to Falken.
  71. ** Doors have the ability to manipulate Falkens databases, but
  72. ** must call Falken to do it.  This structure is set up for the
  73. ** database call, and then the address of this structure is passed
  74. ** to Falken in the mdbs structure below.
  75. */
  76.  
  77. #define MAXKEY 32
  78.  
  79. typedef struct                  /* entry structure in index        */
  80. {
  81.     unsigned long recptr;       /* points to data record           */
  82.     int reclen;                 /* Record length                    */
  83.     char key[MAXKEY];           /* start of record key             */
  84. }   ENTRY;
  85.  
  86.  
  87. struct call_bt_rec
  88. {
  89.     int bt_function;
  90.     int bt_file_id;             /* an index into the IX_DESC array */
  91.     void far *data_addr;
  92.     int far *length;
  93.     ENTRY far *data_key;
  94.     int keynumber;              /* must be 0 */
  95.     int rtnvalue;               /* to be loaded with the return value */
  96. };
  97.  
  98. struct mdbs_rec
  99. {
  100.     int mdbs_type;
  101.     struct call_bt_rec far *cbraddr;
  102.     int tcbnum;
  103.     int far *doneflag;
  104. };
  105.  
  106. extern unsigned char workbuf[];
  107.  
  108. extern int inq, outq, who, numlines;   /* see header comments above */
  109.  
  110. extern struct acct_rec far *acct;
  111. extern struct user_rec far *user;
  112.  
  113. extern struct cfg_rec far *cfg;        /* pointer to BBSCFG record */
  114.  
  115. /*
  116. ** acct and user are useful, giving us the address of the structure arrays.
  117. ** for simplified access, though, we will set up a pointer to OUR
  118. ** element in the array.
  119. **
  120. **   myacct->   will be the account record for the current user
  121. **   myuser->   will be the user record for the current user
  122. */
  123.  
  124. extern struct acct_rec far *myacct;
  125. extern struct user_rec far *myuser;
  126.  
  127. extern int Mytcbnum;
  128.  
  129. extern struct msg3 m3;
  130. extern struct msg1 *m1;
  131. extern struct msg4 *m4;
  132. extern struct msg5 *m5;
  133. extern struct msg6 *m6;
  134. extern struct msg7 *m7;
  135.  
  136.  
  137. extern int  init(void);
  138. extern void logoff(int);
  139. extern void setbinarymode(int);
  140. extern void settextmode(int);
  141. extern void clear_input_buffer(int);
  142. extern void clear_output_buffer(int);
  143. extern void get_port(int port);
  144. extern void return_port(int port);
  145. extern int  get_oba(void);
  146. extern int  get_in_cnt(void);
  147. extern int  bbslog(char *fs);
  148. extern int  qprintf(char *fs,...);
  149. extern int  qputs(char *fs);
  150. extern int  send(char *fs);
  151. extern int  sendtoline(int w, char *fs);
  152. extern void broadcast(char *fs,int *linenums);
  153. extern void sendmsg(int who, int msgnum);
  154. extern void getmsg(int ansiflag, int msgnum, char *fs);
  155. extern int  qgets(char *s, int len);
  156. extern int  tqgets(char *s, int len, int timeout);
  157. extern void waitforempty(void);
  158. extern int  getserialnum(char *s);
  159. extern int  getversion(char *s);
  160. extern void btupag(int lines);
  161. extern void setwatchdog(int line, int value);
  162. extern void btuech(int echoval);
  163. extern int  find_account(char *s1, void *mem);
  164. extern int  start_a_door(char *cmd, int pri);
  165. extern void wait_for_door(int tcbnum);
  166. extern int  load_a_door(char *cmd, int pri);
  167. extern void save_acct(void);
  168. extern int  sendtoq(char *fs, int qnum);
  169. void sendraw (int port, unsigned char *buf, int count);
  170.  
  171. extern int btrv(int fcode, int fd, void *datbuf, int *size,
  172.                     ENTRY * key, int keynum);
  173.  
  174.  
  175. /*
  176. ** FOSSIL function prototypes
  177. */
  178.  
  179. int  f_ovrunerrs(int);
  180. int  f_recv(int, char *, int);
  181. int  f_send(int, char *, int);
  182. int  f_getinfo(int, void *, int);
  183. int  f_status(int);
  184. int  f_setbaud(int,unsigned int);
  185. int  f_initialize(int);
  186. int  f_dtr(int,int);
  187. int  f_flushin(int);
  188. int  f_flushout(int);
  189. int  f_getfc(int);
  190. int  f_flowctrl(int, int);
  191. int  f_purgeout(int);
  192. int  f_deinit(int);
  193. int  f_writechar(int,int);
  194. int  f_readchar(int);
  195. int  f_defline(int,int,int,int);
  196. int  f_getioport(void *);
  197. int  f_kill(void);
  198. int  f_setbufsize(int, int, int);
  199. int  f_getmaxbuf(void);
  200. int  f_setmonline(int);
  201. int  f_readmonbuf(void *);
  202. int  f_insertchar(int,int);
  203. int  f_lock(int,int);
  204. int f_getoba(int);
  205. int f_getibw(int);
  206.  
  207.  
  208. #define ACCT_FILE  0
  209. #define DLOAD_FILE 1
  210. #define BIOS_FILE  2
  211. #define MSG_FILE   3
  212. #define EMAIL_FILE 4
  213. #define ACCT_NUM_FILE 5
  214.  
  215. #ifndef EOF
  216. #define EOF (-1)
  217. #endif
  218.  
  219. #ifndef ERROR
  220. #define ERROR   (-1)
  221. #endif
  222.  
  223. #ifndef OK
  224. #define OK  1
  225. #endif
  226.  
  227. #define FOUND       2
  228. #define NOTFOUND    3
  229.  
  230. /*
  231.     beginning of index and end of index status codes
  232. */
  233.  
  234. #define BOI (-2)                /* beginning of index */
  235. #define EOI (-3)                /* end of index */
  236.  
  237.  
  238. /*
  239. ** The following values are legal for fcode
  240. */
  241.  
  242. #define b_open 0                /* open an existing database file */
  243. #define b_close 1               /* close a database file */
  244. #define b_insert 2              /* insert a record into the database */
  245. #define b_update 3              /* update (modify) an existing record */
  246. #define b_delete 4              /* delete a record */
  247. #define b_getequ 5              /* get the record whose key exactly equals
  248.                                  * 'key' */
  249. #define b_getnext 6             /* get next record, sequentially */
  250. #define b_getprev 7             /* get previous record */
  251. #define b_getgt 8               /* get record whose key > 'key' */
  252. #define b_getge 9               /* get record whose key >= 'key' */
  253. #define b_getlt 10              /* get record whose key < 'key' */
  254. #define b_getle 11              /* get record whose key <= 'key' */
  255. #define b_getlow 12             /* return first record in database */
  256. #define b_gethi 13              /* return last record in database */
  257. #define b_getpos 14             /* UNUSED */
  258. #define b_getdirect 15          /* return this exact record - key and offset */
  259. #define b_getdata 16            /* special case - only read data file at this
  260.                                  * offset! */
  261. #define b_append  17            /* only write to the data file - return
  262.                                  * offset in key */
  263. #define b_create    21          /* create a new index file */
  264.  
  265.